<template>
	<view>
		<view @click="viewJobDetails">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/清单.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">
						查看工单详情</view>
					<view class="p2" style="margin-top: -10px;">View Work Order Details</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="afteSalesIssues">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/问题描述.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">
						日报上报</view>
					<view class="p2" style="margin-top: -10px;">Daily Report</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="journal">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/报告.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">
						日记账上报</view>
					<view class="p2" style="margin-top: -10px;">Journal Reporting</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="examineAndApprove">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/审批.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">
						物料审批</view>
					<view class="p2" style="margin-top: -10px;">Material Approval</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="confirmReporting">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/weixiuquerendan.png"
							style="width: 30px;height: 30px; padding-top: 10px;" :name="icon" :color="colors" size="12">
						</image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">
						维修确认单</view>
					<view class="p2" style="margin-top: -10px;">Repair Confirmation Form</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="dSingleUpload">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/danzi.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">
						提交8D单</view>
					<view class="p2" style="margin-top: -10px;">Submit 8D Order</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="buka">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/buka.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">补卡
					</view>
					<view class="p2" style="margin-top: -10px;">Card Replacement</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<view @click="pingjia">
			<view class="hots" v-if="type===0">
				<view class="left_icon">
					<view class="iconfont">
						<image src="../../../static/pingjia.png" style="width: 30px;height: 30px; padding-top: 10px;"
							:name="icon" :color="colors" size="12"></image>
					</view>
				</view>
				<view class="center">
					<view style="margin-top: -5px;" :class="subtitle!=''?'p1':'title'" :style="'color: '+titleColor">评价
					</view>
					<view class="p2" style="margin-top: -10px;">evaluate</view>
				</view>
				<view class="right" v-if="showmore">
					<image src="../../../static/箭头.png" style="width: 20px;height: 20px; padding-top: 5px;"
						class="right_img" name="arrow-right" color="gray"></image>
				</view>
			</view>
		</view>
		<!-- <modal v-if="sss == true" @confirm="handleConfirm" @cancel='handleConfirm'>
	<wu-card-qr qrName="工单详情" :qrSrc="qyQrSrc" :qrContentList="qrContentList" @clickButton="changeModal('QrCode')"></wu-card-qr>
	</modal> -->
	</view>

</template>

<script>
	export default {
		data() {
			return {
				item: null,
				qyQrSrc: 'https://img13.360buyimg.com/ddimg/jfs/t1/134519/19/12321/36617/5f86b7a2Ed9aaa2d7/746203b11b0cab5a.png',
				qrContentList: [{
						text: '设备类型:',
						value: 'XX',
						cls: 'cuIcon-homefill text-blue',
					},
					{
						text: '出厂时间:',
						value: 'XX',
						cls: 'cuIcon-locationfill text-mauve'
					},
					{
						text: '生产组别:',
						value: 'XX',
						cls: 'cuIcon-locationfill text-mauve'
					},
					{
						text: '客户名称:',
						value: 'XX',
						cls: 'cuIcon-locationfill text-mauve'
					},
				],
				sss: false,

			};
		},

		components: {},
		props: {
			list: Array,

			colors: {
				type: String,
				default: '#55aaff'
			},
			titleColor: {
				type: String,
				default: '#000'
			},
			title: {
				type: String,
				default: ''
			},
			subtitle: {
				type: String,
				default: '',
			},
			showmore: {
				type: Boolean,
				default: true
			},
			type: {
				type: Number,
				default: 0
			},
			icon: {
				type: String,
				default: "star-fill"
			}
		},


		onLoad(option) {
			this.item = JSON.parse(option.item)
			// console.log(this.item)
		},
		methods: {
			handleConfirm() {
				this.sss = false;
			},
			// onReady() {
			//             uni.$on('detailsMsg', (data)=> {
			//                 //我把传过来的数据存到了 data 中
			//                 this.workOrderNumber = data
			//                 // console.log('接收数据',data);
			//             })
			//             uni.$emit('send')
			//         this.qrContentList[0].value = this.workOrderNumber
			//   },
			viewJobDetails() {
				// this.sss = true;
				//跳转到数据所传递到的页面
				uni.navigateTo({
					url: `/pages/afterSaleVue/workOrderNumber/workOrderNumber?item=${JSON.stringify(this.item)}`
				});
			},
			afteSalesIssues() {
				//跳转到数据所传递到的页面
				uni.navigateTo({
					url: `/pages/afterSaleVue/afteSalesIssues/afteSalesIssues?item=${JSON.stringify(this.item)}`
				});
			},
			journal() {
				//跳转到数据所传递到的页面
				uni.navigateTo({
					url: `/pages/afterSaleVue/journal/journal?item=${JSON.stringify(this.item)}`
				});
			},
			examineAndApprove() {
				//跳转到数据所传递到的页面
				// console.log("点击了这个")
				uni.navigateTo({
					url: `/pages/afterSaleVue/examineAndApprove/examineAndApprove?item=${JSON.stringify(this.item)}`
				});
			},
			confirmReporting() {
				//跳转到数据所传递到的页面
				uni.navigateTo({
					url: `/pages/afterSaleVue/confirmationForm/confirmationForm?item=${JSON.stringify(this.item)}`
				});
			},
			dSingleUpload() {
				//跳转到数据所传递到的页面
				uni.navigateTo({
					url: `/pages/afterSaleVue/8dSingleUpload/8dSingleUpload?item=${JSON.stringify(this.item)}`
				});
			},
			buka() {
				//跳转到数据所传递到的页面
				uni.navigateTo({
					url: `/pages/afterSaleVue/cardReplacementApplication/cardReplacementApplication?item=${JSON.stringify(this.item)}`
				});
			},
			pingjia() {
				uni.request({
					url: 'https://www.smacaftersales.com:443/afterSalesEvaluation/afterSalesEvaluation/selectEvaluation',
					method: 'POST',
					data: {
						workid: this.item.workid,
					},
					success: (res) => {
						console.log("--- 评价 ---", res);
						// this.remark = res.data.data[0].content
						if (res.data.data.length > 0) {
							// this.type = 1;
							// this.remark = res.data.data[0].content;
							// this.totalityEvealBase.totalitySatisfied = res.data.data[0].level;
							// this.attitudeScaleBase.attitudeSatisfied = res.data.data[0].attitudeLevel;
							// this.technicalGradeBase.technicalSatisfied = res.data.data[0].technologyLevel
							//跳转到数据所传递到的页面
							uni.navigateTo({
								url: `/pages/afterSaleVue/evaluate/evaluate?item=${JSON.stringify(this.item)}`
							});
						}else{
							console.log(this.item,"***************************")
							uni.navigateTo({
								url: `/pages/afterSaleVue/evaluate/passwordCode?item=${JSON.stringify(this.item)}`
							});
						}
					}
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	.hots {
		padding: 0 3%;
		padding-top: 10upx;
		height: 120upx;
		border-bottom: 1upx solid #F8F8F8;
		overflow: hidden;
	}

	.hots:active {
		opacity: 0.8;
	}

	.left_icon {
		float: left;
	}

	.left_icon .iconfont {
		font-size: 46upx;
		display: inline-block;
		margin-right: 20upx;
		line-height: 100upx;
	}

	.center {
		float: left;

	}

	.title {
		font-size: 28upx;
		font-weight: 500;
		color: #000;
		line-height: 90upx;
		margin-top: 10upx;
	}

	.p1 {
		font-size: 28upx;
		font-weight: 500;
		line-height: 50upx;
		margin-top: 10upx;
	}

	.p2 {
		font-size: 20upx;
		color: #999;
	}

	.right {
		float: right;
	}

	.right .right_img {
		width: 40upx;
		height: 40upx;
		display: inline-block;
		margin-top: 28upx;
	}
</style>